/*
 * RoboEye - Web client for www.newocr.com that allows you
 * to recognize an image captured by the camera.
 *
 * Copyright (C) Oxygen Development, 2011
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

package com.devoxy.roboeye.core.provider;

import android.content.ContentUris;
import android.net.Uri;

/**
 * Created by Oxygen Development.
 * Author: Dmitriy Tarasov (dm.vl.tarasov@gmail.com)
 * Date: 18.06.11
 * Time: 14:44
 */
public final class Task implements Entity {

    /**
     * Name of entity in content provider
     */
    public static final String TABLE = "tasks";

    public static final Uri CONTENT_URI = Uri.parse("content://" + RoboEyeContentProvider.AUTHORITY + "/" + TABLE);

    public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/vnd.devoxy.roboeye.task";

    public static final String CONTENT_TYPE = "vnd.android.cursor.dir/vnd.devoxy.roboeye.task";

    /**
     * Path to photo or directory with photos which must be processed, depends on task type
     */
    public static final String SOURCE = "source";

    /**
     * Path to text file or directory with results, depends on task type
     */
    public static final String TARGET = "target";

    /**
     * True if task already finished
     */
    public static final String FINISHED = "finished";

    /**
     * Task that started now
     */
    public static final String STARTED = "started";

    /**
     * Language of source document
     */
    public static final String LANGUAGE = "language";

    /**
     * Rotate or no source file
     */
    public static final String ROTATION = "rotation";

    /**
     * Single image or directory - 1 or true is a directory, 0 or false is a single file
     */
    public static final String TYPE = "type";

    private Long id;
    private Long createTs;
    private String source;
    private String target;
    private Boolean type;
    private Boolean started;
    private Boolean finished;
    private String language;
    private String rotation;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getCreateTs() {
        return createTs;
    }

    public void setCreateTs(Long createTs) {
        this.createTs = createTs;
    }

    public String getSource() {
        return source;
    }

    public void setSource(String source) {
        this.source = source;
    }

    public String getTarget() {
        return target;
    }

    public void setTarget(String target) {
        this.target = target;
    }

    public Boolean getType() {
        return type;
    }

    public void setType(Boolean type) {
        this.type = type;
    }

    public Boolean getStarted() {
        return started;
    }

    public void setStarted(Boolean started) {
        this.started = started;
    }

    public String getLanguage() {
        return language;
    }

    public void setLanguage(String language) {
        this.language = language;
    }

    public String getRotation() {
        return rotation;
    }

    public void setRotation(String rotation) {
        this.rotation = rotation;
    }

    public Boolean getFinished() {
        return finished;
    }

    public void setFinished(Boolean finished) {
        this.finished = finished;
    }

    public Uri getUri() {
        return ContentUris.withAppendedId(CONTENT_URI, id);
    }
}
